package com.zhuiyun.project.api.sysexamine.controller;


import com.zhuiyun.project.api.sysexamine.service.AppPhysicianService;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.util.pageUtil.PageRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @Author: hui
 * @Descriprion: TODO
 * @Date: 2023/6/25 19:37
 */
@CrossOrigin
@RestController
@RequestMapping("/sysExamine")
public class AppPhysicianController {

    @Autowired
    AppPhysicianService appPhysicianService;

    /* *
     * @Author: hui
     * @Descriprion: 审核全查（未处理的信息）
     * @Date: 2023/6/26 10:26
     * @return null
     * @param null
     */
    @GetMapping("/findAll")
    public CommonResult findAll(PageRequest pageRequest,String doctorName){
        return CommonResult.ok(appPhysicianService.findAll(pageRequest,doctorName));
    }

    /* *
     * @Author: hui
     * @Descriprion: 审核通过
     * @Date: 2023/6/26 14:45
     * @return null
     * @param null
     */
    @PostMapping("/update")
    public CommonResult update(@RequestParam Integer id){
        return CommonResult.ok(appPhysicianService.update(id));
    }

    /* *
     * @Author: hui
     * @Descriprion: 审核不通过（驳回）
     * @Date: 2023/6/26 15:15
     * @return null
     * @param null
     */
    @PostMapping("/reject")
    public CommonResult reject(@RequestParam Integer id){
        return CommonResult.ok(appPhysicianService.reject(id));
    }
    /* *
     * @Author: hui
     * @Descriprion: 医师全查（分页+模糊查询）
     * @Date: 2023/6/26 15:37
     * @return com.zhuiyun.project.common.response.CommonResult
     * @param page
     * @param size
     * @param doctorName
     */
    @GetMapping("/fullPhysician")
    public CommonResult fullPhysician(@RequestParam Integer page,@RequestParam Integer size,@RequestParam(defaultValue = "") String doctorName){
        return CommonResult.ok(appPhysicianService.fullPhysician(page,size, doctorName));
    }
}
